<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.box {
				width: 1200px;
				margin: auto;
			}
			
			.novels a {
				width: 150px;
				/*height: ;*/
				margin-right: 40px;
				margin-bottom: 10px;
				border: solid 1px;
				height: 250px;
				display: inline-block;
			}
			
			.novels a img {
				width: 100%;
				height: 200px;
				margin: auto;
				display: block;
			}
			
			.novels a p {
				text-align: center;
				line-height: 36px;
			}
		</style>
	</head>

	<body>
		<div class="box">
			<p>我的收藏</p>
			<ul class="novels"></ul>
		</div>
		<script type="text/javascript" src="jquery.js"></script>
		<script type="text/javascript">
			var href = 'http://localhost:8000'
			$.ajax({
				type: "post",
				url: href + "/users/zsc",
				data: {
					uid: localStorage.uid
				},
				success(data) {
					console.log(data)
					data.forEach(function(o, i) {
						var oA = $('<a>').attr('uid', data[i].searchuid)
						oA.append($('<img>').attr('src', data[i].searchimg)).append($('<p>').html(data[i].searchname))
						$('.novels').append(oA)
					})
				}
			});
			$('.novels').on('click', 'a', function() {
				var _this = $(this)
				var suid = ''
				if(localStorage.user) {
					var str = href + '/xiang.html?uid=' + _this.attr('uid')
					suid = _this.attr('uid')
					_this.attr('href', str)
				} else {
					$('#login_in').modal('show')
				}
			})
		</script>
	</body>

</html>